import {
    BaseEntity,
    Entity,
    Column,
    PrimaryGeneratedColumn,
    CreateDateColumn,
    UpdateDateColumn,
} from 'typeorm'

enum TaskType { SendFee = 1, Collection = 2 }

@Entity()
class Task extends BaseEntity {
    @PrimaryGeneratedColumn('increment')
    id: number | undefined

    @Column()
    type: number = 0

    @Column()
    params: string = ''

    @Column()
    count: number = 0

    @Column()
    done: boolean = false
    
    @CreateDateColumn({type: 'datetime'})
    createdAt: Date = new Date()

    @UpdateDateColumn({type: 'datetime'})
    updatedAt: Date = new Date()
}


export { Task, TaskType }
